package com.jiyun.service.impl;

import com.alibaba.nacos.common.utils.StringUtils;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jiyun.mapper.ManagesellMapper;
import com.jiyun.pojo.Managesell;
import com.jiyun.service.ManagesellService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author: 刘清芳
 * @description: 出售商品
 * @date: 2023/12/24 19:14
 */
@Service
public class ManagesellServiceImpl extends ServiceImpl<ManagesellMapper, Managesell>implements ManagesellService {
@Autowired
ManagesellService managesellService;

//展示
    @Override
    public Page<Managesell> findAllManagesell(Managesell manageSell, Integer pageNum, Integer pageSize) {
        Page<Managesell> manageSellPage = new Page<>(pageNum, pageSize);
        LambdaQueryWrapper<Managesell> wrapper = new LambdaQueryWrapper<>();
//        商品搜索
        wrapper.like(StringUtils.isNotBlank(manageSell.getName()),
                Managesell::getName,
                manageSell.getName()
        );
        managesellService.page(manageSellPage,wrapper);
        return manageSellPage;
    }
}
